#!/bin/bash 

#case 'a': // Still active, good!
#case 'p': // It's paused
#case 'e': //Failed
#case 'd': //The VM was not found

source $(dirname $0)/utils.sh

# Converts vbox state for ONE vm state
function get_state() {
	local NEBULA_STATE='u'
	local STATE=$(vbox_get_vm_state "$1")
	case $STATE in
		running) NEBULA_STATE='a' ;;
		paused) NEBULA_STATE='p' ;;
		powered_off) NEBULA_STATE='d' ;;
	esac
	echo "STATE=$NEBULA_STATE"
}

echo $(get_state "$1")

exit 0
